﻿using System.Threading.Tasks;

namespace Acme.Abp.SerialNumberGenerator;

public interface IAutoIncrementedNumberGenerator
{
    /// <summary>
    /// 获取上次的增量序号
    /// </summary>
    /// <param name="identify">唯一标识</param>
    /// <param name="start">缺省起始值</param>
    /// <param name="expiredAt">过期时间，时间戳，单位毫秒</param>
    /// <returns></returns>
    ValueTask<long> GetAsync(string identify, long start = 0, long expiredAt = 0);
    /// <summary>
    /// 重置增量序号
    /// </summary>
    /// <param name="identify">唯一标识</param>
    /// <param name="no">重置的增量序号</param>
    /// <param name="expiredAt">过期时间，时间戳，单位毫秒</param>
    /// <returns></returns>
    ValueTask ResetAsync(string identify, long no, long expiredAt);
}